<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge，chrome=1">
    <meta name="renderer" content="webkit">
    <script src="../../../node_modules/jquery/dist/jquery.min.js"></script>
    <link rel="stylesheet" href="../../../node_modules/bootstrap/dist/css/bootstrap.min.css">
    <script src="../../../node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
    <script src="../../../node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
    <script src="../../../node_modules/vue/dist/vue.min.js"></script>
    <link rel="stylesheet" href="../../../node_modules/element-ui/lib/theme-chalk/index.css">
    <script src="../../../node_modules/element-ui/lib/index.js"></script>


    <!-- 自定义 -->
    <script src="../../../node_modules/mockjs/dist/mock.js"></script>
    <script src="../static/js/mock_config.js"></script>
    <script src="../static/js/index.js"></script>
    <link rel="stylesheet" href="../../index.css">

    <!-- PC -->
    <link rel="stylesheet" href="../static/css/HLPurchRec.css" media="only screen and (max-height:1600px) ">

</head>

<body>
    <!--主体-->
    <div class="main clearfix" id="app">

        <div class="header">
            <header>
                <div class="navbar">
                    <div class="card_T">
                        <div class="card A" style="background-color:#0b87fa;color: white;">
                            <ul>
                                <li>
                                    <h8 style="line-height: 78px;">材料采购收货看板</h8>
                                </li>
                            </ul>
                        </div>
                    </div>
                    <div class="pc_content">
                        <div class="card B" style=" background-color: #33814e;">
                            <ul class="list-group list-group-flush">
                                <li class="list-group-item">
                                    <h4>7天待收货 </h4>
                                </li>
                                <li class="list-group-item1">
                                    <h4> {{defaultDt3.length}} 单</h4>
                                </li>
                            </ul>
                        </div>
                        <div class="card B D" style="background-color: #33814e; ">
                            <ul class="list-group list-group-flush">
                                <li class="list-group-item">
                                    <h4>30天待收货</h4>
                                </li>
                                <li class="list-group-item1">
                                    <h4> {{defaultDt2.length}} 单</h4>
                                </li>
                            </ul>
                        </div>
                        <div class="card B C" style="background-color: #FF0000;">
                            <ul class="list-group list-group-flush">
                                <li class="list-group-item">
                                    <h4>逾期未收 </h4>
                                </li>
                                <li class="list-group-item1">
                                    <h4> {{defaultDt1.length}} 单</h4>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>
            </header>
        </div>

        <div class="body_div">
            <div class="main-left">
                <div class="border-container1">
                    <div class="name-title">
                        逾期未交货
                    </div>
                    <div>
                        <el-table :data="defaultDt1" :default-sort="{prop: 'date', order: 'descending'}" stripe="true" ref="defaultDt1" :height=el_table_height1 cell-style="font-size: 18px">
                            <el-table-column prop="ID"    align="center" label="序号">
                            </el-table-column>
                            <el-table-column prop="POID" width="190"   align="center" label="采购单号">
                            </el-table-column>
                            <el-table-column prop="SupplierCode"   align="center" label="供应商">
                            </el-table-column>
                            <el-table-column prop="GoodsCode" align="center" label="材料代号">
                            </el-table-column>
                            <el-table-column prop="RevDate" width="140"  align="center" label="计划交期" :formatter="formatterTime">
                            </el-table-column>
                            </el-table-column>
                            <el-table-column prop="WaitQty" align="center" label="逾期数量">
                            </el-table-column>
                        </el-table>
                    </div>
                    <span class="top-left border-span"></span>
                    <span class="top-right border-span"></span>
                    <span class="bottom-left border-span"></span>
                    <span class="bottom-right border-span"></span>
                </div>

                <div class="border-container1">
                    <div>
                        <div class="name-title">
                            30天待收货
                        </div>
                        <el-table :data="defaultDt2" :default-sort="{prop: 'date', order: 'descending'}" stripe="true" ref="defaultDt2" :height=el_table_height1 cell-style="font-size: 18px">
                            <el-table-column prop="ID"    align="center" label="序号">
                            </el-table-column>
                            <el-table-column prop="POID" width="190"   align="center" label="采购单号">
                            </el-table-column>
                            <el-table-column prop="SupplierCode"   align="center" label="供应商">
                            </el-table-column>
                            <el-table-column prop="GoodsCode" align="center" label="材料代号">
                            </el-table-column>
                            <el-table-column prop="RevDate" width="140"   align="center" label="计划交期" :formatter="formatterTime">
                            </el-table-column>
                            </el-table-column>
                            <el-table-column prop="WaitQty" align="center" label="待收货数">
                            </el-table-column>
                        </el-table>
                    </div>
                    <span class="top-left border-span"></span>
                    <span class="top-right border-span"></span>
                    <span class="bottom-left border-span"></span>
                    <span class="bottom-right border-span"></span>
                </div>
            </div>

            <div class="main-right">
                <div class="border-container">
                    <div class="name-title">
                        7天待收货
                    </div>
                    <div>
                        <el-table :data="defaultDt3" :default-sort="{prop: 'date', order: 'descending'}" stripe="true" ref="defaultDt3" :height=el_table_height cell-style="font-size: 18px">
                            <el-table-column prop="ID"    align="center" label="序号">
                            </el-table-column>
                            <el-table-column prop="POID" width="190"   align="center" label="采购单号">
                            </el-table-column>
                            <el-table-column prop="SupplierCode"   align="center" label="供应商">
                            </el-table-column>
                            <el-table-column prop="GoodsCode" align="center" label="材料代号">
                            </el-table-column>
                            <el-table-column prop="RevDate" width="140"  align="center" label="计划交期" :formatter="formatterTime">
                            </el-table-column>
                            </el-table-column>
                            <el-table-column prop="WaitQty" align="center" label="待收货数">
                            </el-table-column>
                        </el-table>
                    </div>
                    <span class="top-left border-span"></span>
                    <span class="top-right border-span"></span>
                    <span class="bottom-left border-span"></span>
                    <span class="bottom-right border-span"></span>
                </div>
            </div>
        </div>
    </div>

</body>



<script>
    new Vue({
        el: '#app',
        data() {
            return {
                el_table_height: 800,
                el_table_height1: 400,
                defaultDt1: [],
                defaultDt2: [],
                defaultDt3: [],
            }
        },
        methods: {
            GetTabelDate(that) {
                // 逾期未收货
                GetCodeData("VB21123115253787", "Get", "OrderOut").then(function(res) {
                        that.defaultDt1 = res.rows
                    }),
                    // 30天待收货
                    GetCodeData("VB21123115301595", "Get", "OrderOut").then(function(res) {
                        that.defaultDt2 = res.rows
                    }),
                    // 7天待收货
                    GetCodeData("VB21123115294010", "Get", "OrderOut").then(function(res) {
                        that.defaultDt3 = res.rows
                    })
            },
            formatterTime(row, column) {
                let data = row[column.property]
                return /\d{4}-\d{1,2}-\d{1,2}/g.exec(data)
            }
        },

        mounted() {
            TableAotoRoll([this.$refs.defaultDt1, this.$refs.defaultDt2, this.$refs.defaultDt3])
            var that = this
            setTimeout(function() {
                that.GetTabelDate(that)
            }, 0);
            setInterval(function() {
                that.GetTabelDate(that)
            }, 1000 * 60);
        }
    })
</script>



</html>